﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using DTO;
using BUS;

namespace CDT_CSDLNC
{
    public partial class frmDongYMacCa : Form
    {
        public frmDongYMacCa()
        {
            InitializeComponent();
        }

        public string tensp = null;
        public string giamacca = null;
        public string soluongmua = null;
        public string hantraloi;
        public string tinnhan;
        public string maNguoiBan = null;

        private void label8_Click(object sender, EventArgs e)
        {

        }

        private void btnDongY_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void frmDongYMacCa_Load(object sender, EventArgs e)
        {
            txtMaNguoiBan.Text = maNguoiBan;
        }

        private void btnOk_Click(object sender, EventArgs e)
        {
            TinMacCaDTO tmc = new TinMacCaDTO();
            tmc = TinMacCaBUS.getTinMacCa(txtMaNguoiBan.Text);
            if (tmc != null)
            {
                gbTinMacCa.Enabled = true;
                lbGiaMacCa.Text = tmc.GiaDeNghiTra.ToString();
                lbSoLuong.Text = tmc.SoLuongMua.ToString();
                lbHanTraLoi.Text = tmc.HanTraLoi.ToString("dd/MM/yyyy");
                lbTinNhan.Text = tmc.TinNhan;
            }
        }
    }
}
